Skip to content

fix: handle :MISSION:SAVED: async callback from extension#114

Merged
fank merged 3 commits intomainfrom
fix/async-mission-saved-callback
Apr 12, 2026
Merged

fix: handle :MISSION:SAVED: async callback from extension#114
fank merged 3 commits intomainfrom
fix/async-mission-saved-callback

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Apr 11, 2026

Summary

Why

When paired with OCAP2/extension#159, :MISSION:SAVE: returns queued immediately and fires :MISSION:SAVED: later with one of ok, partial, or error. This PR teaches the addon to handle those callbacks and surface the final state to players via CBA notifications.

Without this change the addon still works (the callback is silently ignored), but players see "OCAP saving..." and never learn whether upload succeeded.

Test plan

  • Run a short mission locally, end it, confirm "OCAP saved … successfully" only appears after the upload finishes
  • Run a short mission with an unreachable web service URL, confirm "saved locally … upload failed" appears
  • Run a short mission with storage failure, confirm "OCAP save failed" appears

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the mission saving and uploading process to be asynchronous. It introduces a new :MISSION:SAVED: callback handler in fnc_initSession.sqf to process results and notify users, while updating fnc_exportData.sqf to queue the save and provide an interim status. Feedback suggests adding type validation to the callback data parsing to prevent script errors and updating the diary record creation to reflect the asynchronous nature of the save process, as the current wording remains prematurely optimistic.

@fank fank merged commit da5e728 into main Apr 12, 2026
1 check passed
@fank fank deleted the fix/async-mission-saved-callback branch April 12, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant